#ifndef __CAMERAMACROS_H__
#define __CAMERAMACROS_H__

/**
 * @file CameraMacros.h
 *
 * @brief This file contains common macros used in Core Camera software
 *
 * Copyright (c) 2009, 2011-2012, 2014-2015 Qualcomm Technologies, Inc.
 * All Rights Reserved.
 * Confidential and Proprietary - Qualcomm Technologies, Inc.
 *
 */

/* ===========================================================================
**                      INCLUDE FILES
** =========================================================================*/

/* ===========================================================================
                        DATA DECLARATIONS
=========================================================================== */

/* -----------------------------------------------------------------------
** Constant / Define Declarations
** ----------------------------------------------------------------------- */
#undef BEGIN_NAMESPACE
#define BEGIN_NAMESPACE(x)  \
namespace x                 \
{

#undef END_NAMESPACE
#define END_NAMESPACE       \
}

/* -----------------------------------------------------------------------
** Type Declarations
** ----------------------------------------------------------------------- */

/* -----------------------------------------------------------------------
** Global Data Declarations
** ----------------------------------------------------------------------- */

/* =======================================================================
**                          Macro Definitions
** ======================================================================= */
// Assertions
#if defined(_DEBUG)
  #define CAMERA_ASSERT(x) /*lint -e{506,522,944} */ ((x) || (CameraDebugBreak(), FALSE))
#else /* !_DEBUG */
  #define CAMERA_ASSERT(x)
#endif /* _DEBUG */

/* Define a DEPRECATED and DEPRECATED_ALT macros that can be used to specify
 * functions,types and variables that have been deprecated. */
#undef DEPRECATED
#if defined(_MSC_VER)
  #define DEPRECATED  __declspec(deprecated)
  #if _MSC_VER >= 1400
    #define DEPRECATED_ALT(_alternative)  \
      __declspec(deprecated("This is scheduled to be removed in an upcoming "\
                            "release. Use " #_alternative " instead."))
  #else
    #define DEPRECATED_ALT(_alternative)  __declspec(deprecated)
  #endif  /* _MSC_VER >= 1400 */
#elif defined (__GNUC__) || defined (__ARMCC_VERSION)
  #define DEPRECATED __attribute__((deprecated))
  #define DEPRECATED_ALT(_alternative) __attribute__((deprecated))
#else
  #define DEPRECATED
  #define DEPRECATED_ALT(_alternative)
#endif // _MSC_VER

/**
 * Macro that can be used to deprecate macros. For example, if the macro to
 * deprecate is ARRAY_COUNT(array):
 * #define ARRAY_COUNT(array) DEPRECATED_MACRO(ARRAY_COUNT)
 */
#undef DEPRECATED_MACRO
#define DEPRECATED_MACRO(_macro) \
    DEPRECATED typedef int _macro; typedef _macro _##macro;

/**
 * Macro that can be used to deprecate a macro with suggestion for an
 * alternative. For example, if the macro to deprecate is ARRAY_COUNT(array):
 * #define ARRAY_COUNT(array) DEPRECATED_MACRO_ALT(ARRAY_COUNT,STD_ARRAY_CNT)
 */
#undef DEPRECATED_MACRO_ALT
#define DEPRECATED_MACRO_ALT(_macro,_alternative) \
    DEPRECATED_ALT(_alternative) typedef int _macro; typedef _macro _##macro;

/**
* Macro that can be used to making a c++ method pageable and none pagable
*/

#if defined(_MSC_VER)  && defined(_ARM_)
    #define IRQ_REQUIRED(mode) _IRQL_requires_(mode)
#else //for qnx or offtarget
    #define IRQ_REQUIRED(mode)
#endif

#endif /* __CAMERAMACROS_H__ */
